﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>jQuery ligerUI 中文官方网站</title>
        <script type="text/javascript">
            var tab = null;
            var accordion = null;
            var tree = null;
            $(function () {
                //布局
                $("#layout1").ligerLayout({ leftWidth: 190, height: '100%', onHeightChanged: f_heightChanged });

                var height = $(".l-layout-center").height();

                //Tab
                $("#framecenter").ligerTab({ height: height });

                //面板
                $("#accordion1").ligerAccordion({ height: height - 24, speed: null });

                $(".l-link").hover(function () {
                    $(this).addClass("l-link-over");
                }, function () {
                    $(this).removeClass("l-link-over");
                });
                //树
                $("#tree1").ligerTree({
                    checkbox: false,
                    nodeWidth: 120,
                    url: '/system/menu/GetMenu?r=' + new Date().getTime(),
                    idFieldName: 'id',
                    parentIDFieldName: 'pid',
                    //topParentIDValue: 10,
                    //attribute: ['nodename', 'url'],
                    onSelect: function (node) {
                        //debugger;
                        if (!node.data.url) return;
                        var tabid = $(node.target).attr("tabid");
                        if (!tabid) {
                            //tabid = new Date().getTime();
                            tabid = "qzgfframe" + node.data.id;
                            $(node.target).attr("tabid", tabid);
                            node.data.url = node.data.url + "?_menuid=" + node.data.id;
                        }
                        //f_selectTab(tabid);
                        f_addTab(tabid, node.data.text, node.data.url);
                    },
                    onSuccess: function (node) {
                        tree.collapseAll();
                    }
                });

                tab = $("#framecenter").ligerGetTabManager();
                accordion = $("#accordion1").ligerGetAccordionManager();
                tree = $("#tree1").ligerGetTreeManager();
                $("#pageloading").hide();
                tree.collapseAll();


                //注销
                $("#btnLoginOut").click(function () {
                    $.ajax({
                        type: 'post', cache: false, dataType: 'json',
                        url: '/Home/LoginOut?r=' + new Date().getTime(),
                        success: function (result) {
                            location.href = "/home/login";
                        }
                    });
                });
                //修改密码
                $("#btnChangepwd").click(function () {
                    $.ligerDialog.open({ title: "修改密码",
                        url: '/home/Myconfig?r=' + new Date().getTime(), height: 300, width: null,
                        buttons: [
                        { text: '确定', onclick: function (item, dialog) {
                            var result = dialog.frame.f_save();
                            //alert(result);
                            /*
                            if (result == "2") {
                            $.ligerDialog.alert('原密码错误!');
                            $("#txtoldpwd").focus();
                            } else if (result == "3") {
                            $.ligerDialog.alert('更新失败 !');
                            $("#txtnewpwd").focus();
                            }
                            else {
                            $.ligerDialog.alert('修改成功 !');
                            }*/
                            //dialog.close();
                        }
                        },
                        { text: '取消', onclick: function (item, dialog) { dialog.close(); } }
                        ]
                    });
                });

            });

            function f_heightChanged(options) {
                if (tab)
                    tab.addHeight(options.diff);
                if (accordion && options.middleHeight - 24 > 0)
                    accordion.setHeight(options.middleHeight - 24);
            }
            function f_addTab(tabid, text, url) {
                tab.addTabItem({ tabid: tabid, text: text, url: url });
            }
            
            
     </script> 
<style type="text/css"> 
    body{ padding:0px; margin:0;   overflow:hidden;}  
    .l-link{ display:block; height:26px; line-height:26px; padding-left:10px; text-decoration:underline; color:#333;}
    .l-link2{text-decoration:underline; color:white;}
    .l-layout-top{background:#102A49; color:White;}
    .l-layout-bottom{ background:#E5EDEF; text-align:center;}
    #pageloading{position:absolute; left:0px; top:0px; background:white url('/Content/Lib/images/loading.gif') no-repeat center; width:100%; height:100%; height:700px; z-index:99999;}
    .l-link{ display:block; line-height:22px; height:22px; padding-left:20px;border:1px solid white; margin:4px;}
    .l-link-over{ background:#FFEEAC; border:1px solid #DB9F00;}
 </style>
</head>
<body style="padding:0px;">  
<div id="pageloading"></div>
  <div id="layout1" style="width:100%">
        <div position="top" style="background:#102A49; color:White; ">
            <div style="margin-top:10px; margin-left:10px">jQuery ligerUI 中文官方网站</div>
            <div style="margin-top:10px; margin-left:10px"><a id="btnLoginOut">退出</a>，<a id="btnChangepwd">修改密码</a></div>
        </div>
        <div position="left"  title="主要菜单" id="accordion1"> 
                     <div title="功能列表" class="l-scroll">
                         <ul id="tree1" style="margin-top:3px;">
                                <!--
                                   <li isexpand="false"><span>系统管理</span><ul> 
                                <li url="/system/menu/index"><span>菜单管理</span></li>
                            </ul></li>
                                 -->
                         </ul>
                    </div> 
        </div>
        <div position="center" id="framecenter"> 
            <div tabid="home" title="我的主页" style="height:300px" >
                <iframe frameborder="0" name="home" src="/Home/Welcome"></iframe>
            </div> 
        </div> 
        <div position="bottom">
            Copyright © 2011 www.ligerui.com
        </div>
    </div> 
        <div style="display:none">
    <!-- 流量统计代码 --> 
    </div>
</body>
</html>
